package com.river.userdraw;

import cn.hutool.setting.Setting;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author riverfan
 * 必须序列化，不然就会出错
 */
@Data
@ToString

public class UserDrawConfig implements Serializable {

    public String Separator;
    public Integer dateIndex ;
    public Integer mdnIndex ;
    public Integer appIDIndex ;
    public Integer countIndex ;
    public Long procedureTimeIndex ;

    public static UserDrawConfig getInstance(){
        UserDrawConfig userDrawConfig = new UserDrawConfig();

        Setting setting = new Setting("UserDraw.properties");


        userDrawConfig.setSeparator(setting.get("Separator"));
        userDrawConfig.setDateIndex(Integer.valueOf(setting.get("Date")));
        userDrawConfig.setMdnIndex(Integer.valueOf(setting.get("MDN")));
        userDrawConfig.setAppIDIndex(Integer.valueOf(setting.get("appID")));
        userDrawConfig.setCountIndex(Integer.valueOf(setting.get("count")));
        userDrawConfig.setProcedureTimeIndex(Long.valueOf(setting.get("ProcedureTime")));
        return userDrawConfig;

    }
}
